﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DelegatePractise.one
{
    internal class DelegateLogger101
    {
    }

    public delegate void LogHandler(string message);

    public class Logger
    {
        // 实现
        public void LogToFile(string message) { }
    }

    // 通过 delegate 传递行为
    public class Service2
    {
        private readonly LogHandler _logHandler;
        public Service2(LogHandler logHandler) => _logHandler = logHandler;
    }
}
